package com.love.cloud.common.core.util;

/**
 * @author hongdongqu
 */
public class SequenceUtils {

    public static String getSequence(long seq,int length) {
        String str = String.valueOf(seq);
        int len = str.length();
        if (len >= length) {// 取决于业务规模,应该不会到达3
            return str;
        }
        int rest = length - len;
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < rest; i++) {
            sb.append('0');
        }
        sb.append(str);
        return sb.toString();
    }
}
